class ProjectSqlMap(object):
    MESSAGE_LIST = "select t7.dept_name,t1.project_id,t1.project_name,t1.customer,t1.contact,t1.contact_phone,t1.floor_space,t1.car_num,t1.location,t1.note,t1.project_description,t1.project_type,t1.project_state,t4.real_name as marketer,t5.real_name as project_manager from project as t1 inner join aoa_user as t4 on t1.marketer=t4.user_id inner join aoa_user as t5 on t1.project_manager=t5.user_id inner join aoa_dept as t7 on t1.dept_id = t7.dept_id"

    TASK_LIST = "select t.title,t4.status_name,u2.real_name,t.star_time,t.end_time " \
                  "from aoa_task_list as t inner join aoa_task_user as tu on tu.task_id=t.task_id " \
                  "inner join aoa_user as u2 on u2.user_id=t.task_push_user_id " \
                  "inner join aoa_status_list as t4 on t4.status_id=t.status_id " \
                  "where tu.task_recive_user_id={user_id}"

    project_task_all = "select t1.task_id,t1.title,t1.star_time,t1.end_time,t1.priority_level,t1.progress_speed,t1.reciverlist,t4.status_name from aoa_task_list as t1 inner join aoa_status_list as t4 on t1.status_id=t4.status_id where t1.task_project_id={project_id}"
    project_task_fillter = "select t1.task_id,t1.title,t1.star_time,t1.end_time,t1.priority_level,t1.progress_speed,t1.reciverlist,t4.status_name from aoa_task_list as t1 inner join aoa_status_list as t4 on t1.status_id=t4.status_id where t1.task_project_id={project_id} and t1.status_id={status_id}"

    TASK_ADD1 = "insert into aoa_task_list(title,status_id,task_describe,star_time,end_time,reciverlist,task_push_user_id,modify_time,publish_time,task_project_id) values('{title}',{status_id},'{task_describe}','{star_time}','{end_time}','{reciverlist}',{task_push_user_id},now(),now(),{task_project_id})"
    TASK_ADD2 = "insert into aoa_task_list(title,status_id,task_describe,star_time,end_time,reciverlist,task_push_user_id,modify_time,publish_time) values('{title}',{status_id},'{task_describe}','{star_time}','{end_time}','{reciverlist}',{task_push_user_id},now(),now())"
    TASK_USER_ADD = "insert into aoa_task_user(status_id,task_id,task_recive_user_id) values({status_id},{task_id},{task_recive_user_id})"
    FIND_NAME = "select real_name from aoa_user where user_id={user_id}"

    project_circle_add = "insert into project_daily_report(publish_time,report_content,project_id,publish_user_id) values(now(),'{report_content}',{project_id},{user_id})"
    project_circle_list = "select t1.*,t2.img_path,t2.real_name,t3.project_name from project_daily_report as t1 inner join aoa_user as t2 on t1.publish_user_id=t2.user_id inner join project as t3 on t1.project_id=t3.project_id"

    PROJECT_LIST = "select t1.create_time,t1.customer,t1.project_id,t1.project_name,t2.dept_name,t1.project_state,t1.project_type,t5.real_name as manager_name from project as t1 inner join aoa_dept as t2 on t1.dept_id=t2.dept_id inner join aoa_user as t5 on t1.project_manager=t5.user_id"

    CHECK_STATUS_ID = "select status_id from aoa_status_list where status_name='未开始'"
    GET_ID = "select @@IDENTITY as id"

    FILTER_PARAMS = {
        "query_str": "t1.project_name like '%{query_str}%'",
        "query_str_circle": "t1.report_content like '%{query_str_circle}%'",
        "project_id": "t1.project_id={project_id}",
        "status_id": "t1.status_id={status_id}",
        "query_str_task": "t1.title like '%{query_str_task}%'"
    }